﻿<?php 
	session_start();
	require 'auth.php';
	if($currenttype!='boss'&&$currenttype!='admin') die("无权限！只有管理员才能修改")
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>聚合物产品工程科技创新团队药品管理软件|修改</title>
</head>

<body>
<a id="logout" href="logout.php">登出</a>
<script type="text/javascript">

function validate_required(field,alerttxt)
{
with (field)
  {
  if (value==null||value=="")
    {alert(alerttxt);return false}
  else {return true}
  }
}

function validate_form(thisform)
{
with (thisform)
  {
  	if (validate_required(ypmc,"请输入药品名称")==false)
    	{ypmc.focus();return false}
  	if (validate_required(lyl,"请输入领用量")==false)
    	{lyl.focus();return false}
	if (validate_required(syrq,"请输入存放地点")==false)
    	{cfd.focus();return false}
	if (validate_required(lyr,"请输入领用人")==false)
    	{lyr.focus();return false}
	if (validate_required(lyrq,"请输入领用日期")==false)
    	{lyrq.focus();return false}
	if (validate_required(admin,"请输入管理员")==false)
    	{admin.focus();return false}
	if (validate_required(jfh,"请输入经费号")==false)
    	{admin.focus();return false}
 }
}
</script>
<div class="header">
  	<img src="ypglhead.png" width="800" height="120" alt="标题" />
</div>
<div class="content">
<p>
  <?php
	//echo $_GET['id'];
  	require "connectdb.php";
	$result = mysql_query("SELECT * FROM reagent_data where id='".$_GET['id']."'");
	$row = mysql_fetch_array($result);
  ?>

</p>
<form action=<?php echo "'modifydo.php?id=" . $_GET['id'] . "'"; ?> onsubmit="return validate_form(this)" method="post">
<table border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td width="400" valign="top"><p>药品名称(必填)：<input type="text" name="ypmc" size="30" <?php echo "value='".$row['ypmc']."'"; ?>> <br />
      领用量(必填)： <input type="text" name="lyl" size="30" <?php echo "value='".$row['lyl']."'"; ?>><br />
      生产日期： <input type="text" name="scrq" size="30" <?php echo "value='".$row['scrq']."'"; ?>><br />
      保质期： <input type="text" name="bzq" size="30" <?php echo "value='".$row['bzq']."'"; ?>><br />
      存放地点(必填)： <input type="text" name="cfd" size="30" <?php echo "value='".$row['cfd']."'"; ?>><br />
      领用人(必填)： <input type="text" name="lyr" size="30" <?php echo "value='".$row['lyr']."'"; ?>><br />
      经费号： <input type="text" name="jfh" size="30"
<?php echo "value='".$row['jfh']."'"; ?>><br />
      是否隐藏： <input type="checkbox" name="yc" size="30" <?php echo "value='1'"; ?> <?php if($row['yc']==1) echo "checked=''"; ?>> </p></td>
    <td width="400" valign="top"><p>领用日期(必填)：<input type="text" name="lyrq" size="30" <?php echo "value='".$row['lyrq']."'"; ?>> <br />
      规格： <input type="text" name="gg" size="30" <?php echo "value='".$row['gg']."'"; ?>><br />
      生产商：<input type="text" name="scs" size="30" <?php echo "value='".$row['scs']."'"; ?>> <br />
      国别： <input type="text" name="gb" size="30" <?php echo "value='".$row['gb']."'"; ?>><br />
      供货商： <input type="text" name="ghs" size="30" <?php echo "value='".$row['ghs']."'"; ?>><br />
      核销日期： <input type="text" name="hxrq" size="30" <?php echo "value='".$row['hxrq']."'"; ?>><br />
      管理员(必填)： <input type="text" name="admin" size="30" <?php echo "value='".$row['admin']."'"; ?>><br />
      剧毒： <input type="checkbox" name="jd" size="30" <?php echo "value='1'"; ?> <?php if($row['jd']==1) echo "checked=''"; ?>> 
      第一类易制毒： <input type="checkbox" name="dylyzd" size="30" <?php echo "value='1'"; ?> <?php if($row['dylyzd']==1) echo "checked=''"; ?>>  
    </p></td>
  </tr>
</table>
<input type="submit" value="提交"> 
</form>
<?php require "back.php";?>
</div>
</body>
</html>